package com.tr09.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tr09.dao.RecevingDAO;

/**
 * Servlet implementation class EditReceivingServlet
 */
@WebServlet("/edit_receiving")
public class EditReceivingServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private RecevingDAO recevingDAO=new RecevingDAO();
    /**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	request.setCharacterEncoding("utf-8");
	int rId=Integer.parseInt(request.getParameter("rId"));
	System.out.println(rId);
	String curpage=request.getParameter("curpage");
	String rReceivingaddress=request.getParameter("rReceivingaddress");
	String rName=request.getParameter("rName");
	String rPostCard=request.getParameter("rPostCard");
	String rPhone=request.getParameter("rPhone");
	recevingDAO.edit(rReceivingaddress, rName,rPostCard, rPhone,rId);
	System.out.println(rId);
	request.getRequestDispatcher("recevinglist.jsp").forward(request, response);
	}
}
